package org.example.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.utils.MinioUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@RestController
@Api(tags = "测试-yc")
@RequestMapping("/byzq-yc/test")
public class TestController {

  @Autowired private MinioUtils minioUtils;

  @PostMapping("/upload")
  @ApiOperation("上传")
  public String upload() {
      return "test";
  }

  @GetMapping("/download")
  @ApiOperation("下载")
  public void download(@RequestParam("fileName") String fileName, HttpServletResponse response) throws IOException {
    minioUtils.download(fileName, response);
  }
}
